//Wdg2DPlot.hpp
#pragma once
/*    widgetpp - A simple C++ wrapper of DISLIN graphic library               */
/*                                                                            */
/*    Copyright (C) 2012  Mirko Cambi (email: mirko.cambi@gmail.com)          */
/*                                                                            */
/*    This program is free software: you can redistribute it and/or modify    */
/*    it under the terms of the GNU General Public License as published by    */
/*    the Free Software Foundation, either version 3 of the License, or       */
/*    (at your option) any later version.                                     */
/*                                                                            */
/*    This program is distributed in the hope that it will be useful,         */
/*    but WITHOUT ANY WARRANTY; without even the implied warranty of          */
/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
/*    GNU General Public License for more details.                            */
/*                                                                            */
/*    You should have received a copy of the GNU General Public License       */
/*    along with this program.  If not, see <http://www.gnu.org/licenses/>.   */

#include <boost/config.hpp>
#include <boost/function.hpp>

#include "widgetpp.hpp"
#include "WdgTitle.hpp"
#include "Wdg2DAxis.hpp"

namespace wdgpp {

class Wdg2DPlot: public WdgRoot
{
public:
   typedef boost::function<void (void)> draw_fun_type; 
   
   Wdg2DPlot();
   void init(int ip = 0, int nxp = 0, int nyp = 0, bool border = true);

   void cartesian_axis(
      float xlo, float xup, float xstart, float xstep, 
      float ylo, float yup, float ytart, float ystep
   );  
   void polar_axis(
      float xup, float xstart, float xstep, float ytart, float ystep
   );  
   
   void set_position(int x, int y) const;
   void set_lenght(int xlen, int ylen) const;
   void set_draw_function(draw_fun_type f);
   void set_title(WdgTitle *title);
   void set_axis(Wdg2DAxis *axis);

   void erase() const;
   void close() const;
   
   void draw() const;
   
private:
   bool _graf;
   draw_fun_type _draw_fun;
   WdgTitle *_title;
   Wdg2DAxis *_axis;
};

} // namespace wdgpp

